<template>
  <div class="post-item">
<!--    <li class="list-group-item">-->
<!--      <div class="handle col-sm-offset-2 col-sm-10">-->
<!--        <a class="pull-right" @click="checkItem">查看</a>-->
<!--      </div>-->
    <div class="message">
      <span class="name">用户{{ authorId }}发帖</span>
      <span class="time">标题：{{ postName }}</span>
    </div>
<!--    <div class="contents">-->
<!--      {{ content }}-->
<!--    </div>-->
    <button class="pull-right" color="deep-purple accent-4" right  @click="checkItem">查看</button>
<!--      <p class="author">-->
<!--        {{authorId+':'}}-->
<!--      </p>-->
<!--      <p class="content">-->
<!--        {{content}}-->
<!--      </p>-->
<!--      <p class="time">-->
<!--        <span class="date">发布日期：</span>-->
<!--        <button class="pull-right" color="deep-purple accent-4" right  @click="checkItem">查看</button>-->
<!--      </p>-->
<!--      <p class="user">-->
<!--        <span style="font-size: 18px;">{{authorId}}</span>-->
<!--        <span style="font-size: 18px;">{{content}}</span>-->
<!--      </p>-->
<!--    </li>-->
  </div>
</template>

<script>
export default {
  name: "PostItem",
  props: {
      postName: {
        type: String,
        default: "SubjectName"
      },
      content:{
        type:String,
        default:""
      },
      authorId: {
      type: Number,
      default: 0
    },
      postId:{
      type:Number,
      default:0
    }
  },
  methods: {
    checkItem() {
      const {courseId} = this.$route.params;
      this.$router.push(`/student/course/${courseId}/discussion/${this.postId}`);
    }
  }
}
</script>

<style lang="scss" scoped>
.post-item {
  position: relative;
  padding: 10px 10px 10px 75px;
  box-sizing: border-box;
  border-bottom: 1px solid gray;
  .message {
    height: 20px;
    line-height: 20px;
    .name {
      font-size: 14px;
      color: #778087;
    }
    .time {
      margin-left: 10px;
      font-size: 12px;
      color: #cccccc;
    }
  }
  .contents {
    padding-top: 10px;
    font-size: 14px;
    color: #444444;
  }
}
</style>